using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using HengTong.Model.Db.Article;
using HengTong.Model;


namespace HengTong.ViewModel.Article.SysArticleVms
{
    public partial class SysArticleTemplateVm : BaseTemplateVM
    {
        [Display(Name = "文章标题")]
        public ExcelPropety TitleExcel = ExcelPropety.CreateProperty<SysArticle>(x => x.Title);
        [Display(Name = "副标题")]
        public ExcelPropety SubTitleExcel = ExcelPropety.CreateProperty<SysArticle>(x => x.SubTitle);
        [Display(Name = "文章摘要")]
        public ExcelPropety SummaryExcel = ExcelPropety.CreateProperty<SysArticle>(x => x.Summary);
        [Display(Name = "文章内容")]
        public ExcelPropety ContentExcel = ExcelPropety.CreateProperty<SysArticle>(x => x.Content);
        [Display(Name = "文章状态")]
        public ExcelPropety StatusExcel = ExcelPropety.CreateProperty<SysArticle>(x => x.Status);
        [Display(Name = "文章分类")]
        public ExcelPropety CategoryExcel = ExcelPropety.CreateProperty<SysArticle>(x => x.CategoryId);
        [Display(Name = "排序")]
        public ExcelPropety SortOrderExcel = ExcelPropety.CreateProperty<SysArticle>(x => x.SortOrder);
        [Display(Name = "是否置顶")]
        public ExcelPropety IsTopExcel = ExcelPropety.CreateProperty<SysArticle>(x => x.IsTop);
        [Display(Name = "是否推荐")]
        public ExcelPropety IsRecommendExcel = ExcelPropety.CreateProperty<SysArticle>(x => x.IsRecommend);
        [Display(Name = "阅读次数")]
        public ExcelPropety ViewCountExcel = ExcelPropety.CreateProperty<SysArticle>(x => x.ViewCount);
        [Display(Name = "点赞次数")]
        public ExcelPropety LikeCountExcel = ExcelPropety.CreateProperty<SysArticle>(x => x.LikeCount);
        [Display(Name = "评论次数")]
        public ExcelPropety CommentCountExcel = ExcelPropety.CreateProperty<SysArticle>(x => x.CommentCount);
        [Display(Name = "收藏次数")]
        public ExcelPropety FavoriteCountExcel = ExcelPropety.CreateProperty<SysArticle>(x => x.FavoriteCount);
        [Display(Name = "分享次数")]
        public ExcelPropety ShareCountExcel = ExcelPropety.CreateProperty<SysArticle>(x => x.ShareCount);

	    protected override void InitVM()
        {
            CategoryExcel.DataType = ColumnDataType.ComboBox;
            CategoryExcel.ListItems = DC.Set<SysArticleCategory>().GetSelectListItems(Wtm, y => y.CategoryName);
        }

    }

    public class SysArticleImportVm : BaseImportVM<SysArticleTemplateVm, SysArticle>
    {

    }

}
